AddPrefabPostInit(
    "birdcage",
    function(inst)
        if not TheWorld.ismastersim then
            return
        end
        inst:AddComponent("npc_base_lib")
        inst:AddComponent("npc_everything_data")


        ------------------------------ 标记该建筑为玩家建造的
        inst:ListenForEvent("onbuilt",function(inst,_table)
            if _table and _table.builder and _table.builder:HasTag("player") then
                inst.npc_everything_data:Set("onbuilt_by_player",true)
            end
        end)
        inst:DoTaskInTime(0,function()
            if inst.npc_everything_data:Get("onbuilt_by_player") then
                inst:AddTag("onbuilt_by_player")
            end
        end)
        ---------------------------------------------------
        ----------------------------------------------------
        ----- OnLoad 的时候检查是否出售
        inst:ListenForEvent("tag_for_sale_task",function()
            if inst.npc_everything_data:Get("for_sale") == true and inst.npc_everything_data:Get("onbuilt_by_player") == true then
                inst.npc_base_lib:For_Sale_Sign_Show()
            end
        end)
        inst:DoTaskInTime(0,function()
            inst:PushEvent("tag_for_sale_task")
        end)
        ---------------------------------------------------
    end
)